export function getWeeekdata(cdate){  //cdate 传来当前的时间
  let now = new Date(cdate);
  let year = now.getFullYear();
  let month = now.getMonth() + 1;
  let date = now.getDate();
  let nowTime = now.getTime();
  let day = now.getDay();
  let oneDayTime = 24 * 60 * 60 * 1000;
  //显示周一
  var MondayTime = nowTime - (day - 1) * oneDayTime;
  //显示周日
  var SundayTime = nowTime + (7 - day) * oneDayTime;
  //初始化日期时间
  var monday = new Date(MondayTime);
  var sunday = new Date(SundayTime);
  return [format(monday), format(sunday)];
}
function format(date) {
  var time = new Date(date);
  var y = time.getFullYear();
  var m =
    time.getMonth() + 1 < 10 ? "0" + time.getMonth() + 1 : time.getMonth() + 1;
  var d = time.getDate() < 10 ? "0" + time.getDate() : time.getDate();
  //var h = time.getHours();
  //var mm = time.getMinutes();
  //var s = time.getSeconds();
  return y + "-" + m + "-" + d;
}
